package com.ctshk.rpc.train.entity.es;

import com.ctshk.common.constant.ElasticSearchConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 火车车次表
 * </p>
 *
 * @author 彭柳霖
 * @since 2021-03-10
 */
@Data
@ApiModel(value="TrainNumberCache对象", description="火车车次缓存表")
@Document(indexName = ElasticSearchConstant.TRAIN_INDEX, createIndex = true)
public class TrainNumberCache implements Serializable {

    private static final long serialVersionUID = 1L;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "火车车次id")
    private Long id;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "车次类型")
    private Long typeId;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "车次类型名称")
    private String typeName;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "车次名称")
    private String trainNumberName;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "出发城市id")
    private Long departureCityId;

    @ApiModelProperty(value = "出发城市名称")
    private String departureCityName;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "到达城市id")
    private Long arriveCityId;

    @ApiModelProperty(value = "到达城市名称")
    private String arriveCityName;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "始发站点id")
    private Long departureStationId;

    @ApiModelProperty(value = "始发站点名称")
    private Long departureStationName;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "终点站id")
    private Long terminusId;

    @ApiModelProperty(value = "终点站名称")
    private String terminusName;

    @Field(type = FieldType.Nested)
    @ApiModelProperty(value = "车次产品列表")
    private List<TrainProductCache> trainProductCacheDTOS;

    @Field(type = FieldType.Nested)
    @ApiModelProperty(value = "火车经停站信息")
    private List<TrainStopStationCache> trainStopStationCacheDTOS;

}
